package actions;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import beans.User;
import beans.UserDAO;

public class UserActionModify implements UserAction {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException {
		request.setCharacterEncoding("utf-8");
		String userno =(String) request.getSession().getAttribute("userno");//注意，如果input设置成disabled，则无法传递数据
		
		boolean flag;
		User user=null;//Map<String, Object> map=null;
		UserDAO userDAO=new UserDAO();
		user=userDAO.findone2(userno);
		request.getSession().setAttribute("user", user);
				
		response.sendRedirect("modify.jsp");
		
		
		//测试一分之后，session是否还活着，侦听器显示是退出了，但怎么session中的数据还用哟？
		/*if(request.getSession(false)==null){
			System.out.println("session 过期了");
			pageContext.setAttribute("gq", "过期");	
		}*/


	}

}
